import request from '../../api/request'
import globalData from '../../utils/global'

// 首页头部待处理报名、经营数据 
export function workTopInfo(data) {
    return request.get(globalData.zpUrl + '/api/v2/zp/job/statistic', data).then(res => {
        return res.data.data
    })
}
// 工资条列表
export function workList(data) {
    return request.get(globalData.zpUrl + '/api/v2/zp/job/list', data).then(res => {
        return res.data.data
    })
}

// 待处理页面列表 /api/v2/zp/job/staff/apply/record
export function workPendingList(data) {
    return request.get(globalData.zpUrl + '/api/v2/zp/job/staff/apply/record', data).then(res => {
        return res.data.data
    })
}
// 接受 /api/v2/zp/job/staff/apply/confirm
export function wokrAccept(data) {
    return request.post(globalData.zpUrl + '/api/v2/zp/job/staff/apply/confirm', data).then(res => {
        return res.data.data
    })
}

// 拒绝 /api/v2/zp/job/staff/apply/reject
export function workRefuse(data) {
    return request.post(globalData.zpUrl + '/api/v2/zp/job/staff/apply/reject', data).then(res => {
        return res.data.data
    })
}

// 岗位信息 /api/v2/zp/job/intro
export function workDetailInfo(data) {
    return request.get(globalData.zpUrl + '/api/v2/zp/job/intro', data).then(res => {
        return res.data.data
    })
}

// 岗位员工列表 /api/v2/zp/job/staff/list
export function workDetailList(data) {
    return request.get(globalData.zpUrl + '/api/v2/zp/job/staff/list', data).then(res => {
        return res.data.data
    })
}

// 新建职位分类列表 /api/v2/zp/job/classify/list
export function positionSortList(data) {
    return request.get(globalData.zpUrl + '/api/v2/zp/job/classify/list', data).then(res => {
        return res.data.data
    })
}

// 放鸽子 
export function workBrokeDove(data) {
    return request.post(globalData.zpUrl + '/api/v2/zp/job/staff/no-sign-in', data).then(res => {
        return res.data.data
    })
}

// 签到
export function workSignIn(data) {
    return request.post(globalData.zpUrl + '/api/v2/zp/job/staff/sign-in', data).then(res => {
        return res.data.data
    })
}

// 取消接单 /api/v2/zp/job/staff/cancel-sign-in
export function workCancelReceipt(data) {
    return request.post(globalData.zpUrl + '/api/v2/zp/job/staff/cancel-sign-in', data).then(res => {
        return res.data.data
    })
}

// 导出名单
export function workExportNameList(data) {
    return request.get(globalData.zpUrl + '/api/v2/zp/job/staff/export', data).then(res => {
        return res.data.data
    })
}

// 上下架 /api/v2/zp/job/status-manage
export function workStatusManage(data) {
    return request.put(globalData.zpUrl + '/api/v2/zp/job/status-manage', data).then(res => {
        return res.data.data
    })
}

// 查询职位模板（做新建岗位默认值） /api/v2/zp/job/classify/template
export function workTemplateList(data) {
    return request.get(globalData.zpUrl + '/api/v2/zp/job/classify/template', data).then(res => {
        return res.data.data
    })
}

// 新增岗位 /api/v2/zp/job/create
export function establishWork(data) {
    return request.post(globalData.zpUrl + '/api/v2/zp/job/create', data).then(res => {
        return res.data.data
    })
}

// 编辑岗位 /api/v2/zp/job/edit
export function editWork(data) {
    return request.put(globalData.zpUrl + '/api/v2/zp/job/edit', data).then(res => {
        return res.data.data
    })
}

// 岗位回显 /api/v2/zp/job/detail
export function workDetailEcho(data) {
    return request.get(globalData.zpUrl + '/api/v2/zp/job/detail', data).then(res => {
        return res.data.data
    })
}


// 上传附件 /api/v2/zp/job/upload-file
export function workUploadFile(data) {
    return request.post(globalData.zpUrl + '/api/v2/zp/job/upload-file', data).then(res => {
        return res.data.data
    })
}

// 工岗位时间轴 /api/v2/zp/job/staff/statistic
export function workDateList(data) {
    return request.get(globalData.zpUrl + '/api/v2/zp/job/staff/statistic', data).then(res => {
        return res.data.data
    })
}

// 月转日  api/v2/zp/job/staff/list-month
export function jobMonthList(data) {
    return request.get(globalData.zpUrl + '/api/v2/zp/job/staff/list-month', data).then(res => {
        return res.data.data
    })
}

// 历史报名列表 api/v2/zp/job/statistics/list-month
export function signUpList(data) {
    return request.get(globalData.zpUrl + '/api/v2/zp/job/statistics/list-month', data).then(res => {
        return res.data.data
    })
}


// 经营数据详情 头部数据 api/v2/zp/job/statistics/total-apply
export function operatingTopData(data) {
    return request.get(globalData.zpUrl + '/api/v2/zp/job/statistics/total-apply', data).then(res => {
        return res.data.data
    })
}

// 经营数据页面 图表数据 api/v2/zp/job/statistics/week-apply 
export function operatingChartData(data) { 
    return request.get(globalData.zpUrl + '/api/v2/zp/job/statistics/week-apply', data).then(res => {
        return res.data.data
    })
}

// 邀请其他驻厂 api/v2/zp/job/leader/batch
export function jobInvitationLeader(data) {
    return request.post(globalData.zpUrl + '/api/v2/zp/job/leader/batch', data).then(res => {
        return res.data.data
    })
}

// 查询招聘驻厂人员 api/v2/zp/job/leader/user-id-list
export function recruitLeaderList(data) {
    return request.get(globalData.zpUrl + '/api/v2/zp/job/leader/user-id-list', data).then(res => {
        return res.data.data
    })
}

// 报名记录列表 
export function getMonthGroupList(data) {
    return request.get(globalData.zpUrl + '/api/v2/zp/job/staff/list-month-group', data).then(res => {
        return res.data.data
    })
}

// 岗位删除 
export function jobOffShelf(data) {
    return request.post(globalData.zpUrl + '/api/v2/zp/job/del', data).then(res => {
        return res.data.data
    })
}